<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <script>
    let str = '12#3'
    let reg = new RegExp(/^[0-9]+$/)
    console.log(reg.test(str))
    let arr = [1, 2, 3]
    function fn() {
      for (let i = 0; i < arr.length; i++) {
        if (i === 1) {
          console.log('return')
          return
        }
      }
      console.log('最后')
    }
    fn()

  </script>
</body>

</html>